﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AcademyEcosystem
{
    public class Lion : Animal, ICarnivore
    {
        private const int BirthSize = 6;
        private const int HowBigger = 2;
        
        private int sizeAnimalLionCanEat;
        
        public Lion(string name, Point location)
            : base(name, location, BirthSize)
        {


        }

        public int TryEatAnimal(Animal animal)
        {
            if (animal != null && animal.Size <= CalculateAnimalSizeLionCanEat())
            {
                this.Size++;

                return animal.GetMeatFromKillQuantity();
            }

            return 0;
        }

        private int CalculateAnimalSizeLionCanEat()
        {
            return this.sizeAnimalLionCanEat = HowBigger * this.Size;
        }
    }
}
